package view.mt4j.util;

import org.mt4j.components.visibleComponents.widgets.keyboard.ITextInputListener;

public abstract class TextAreaInputListener implements ITextInputListener {

	final ITextInputListener listener;

	public TextAreaInputListener(final ITextInputListener listener) {
		super();
		this.listener = listener;
	}

	@Override
	public void appendCharByUnicode(String unicode) {
		listener.appendCharByUnicode(unicode);
		onTextChange();
	}

	@Override
	public void appendText(String text) {
		listener.appendText(text);
		onTextChange();
	}

	@Override
	public void clear() {
		listener.clear();
		onTextChange();
	}

	@Override
	public void removeLastCharacter() {
		listener.removeLastCharacter();
		onTextChange();
	}

	@Override
	public void setText(String text) {
		listener.setText(text);
		onTextChange();
	}
	
	public abstract void onTextChange();

}
